#ifndef PASSWORD_CLASS
#define PASSWORD_CLASS
#include <iostream>
#include <string>
namespace PASSWORDS
{
class password
{
public:
	//empty password element
	password(void);
	//password element with at least a name
	password(std::string name, std::string userPassword="NONE", std::string usage="NONE", std::string userHint="NONE");
	~password(void);
	
	friend std::ostream &operator<<( std::ostream &, const password & ) ;
	friend std::istream &operator>>( std::istream &, password & ) ; 
protected:
	static const int sepSize = 3;
	static std::string sep;// = "^#%";
	static enum ENTRIES {
		NAME=0,
		PASSWORD,
		HINT,
		REF};	
	static std::string getChunk(std::istream &input);
	static int getEntrySize(std::string &input, std::size_t begin, std::size_t end);
	static std::string getToken(std::string &input, std::size_t begin, std::size_t size);	
private:
	std::string userName;
	std::string passwordEntry;
	std::string hint;
	std::string usageReference;		
};

} //end namespace PASSWORDS
#endif PASSWORD_CLASS